<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button onclick="alert('hello')">click</button>
		<input type="button" value="click1" onclick="cli()" onmouseover="over()" onmouseout="out()"/>
		<input id="btnId" type="button" value="click2"/>

		<script type="text/javascript">
			window.onload = function(){
				var btn = document.getElementById('btnId');
				btn.onclick = function(){
					console.log('onclick');
				}
				btn.onmouseover = function(){
					console.log('onmouseover');
				}
				btn.onmouseout = function(){
					console.log('onmouseout');
				}
			}
			function cli(){
				console.log('cli');
			}
			function over(){
				console.log('over');
			}
			function out(){
				console.log('out');
			}
		</script>
	</body>
</html>
